<html>
<head><meta charset="utf-8"><title>rustdoc takes a long time to build · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html">rustdoc takes a long time to build</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218946739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218946739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218946739">(Dec 05 2020 at 18:28)</a>:</h4>
<p>The rustdoc crate itself, that is, not all the rustc_middle dependencies. It takes about 40 seconds with incr-full and 30 seconds with incr-patched.</p>



<a name="218946750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218946750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218946750">(Dec 05 2020 at 18:29)</a>:</h4>
<p>I'm timing this with the original chagnes from <a href="https://github.com/rust-lang/rust/pull/79540">https://github.com/rust-lang/rust/pull/79540</a> which use <code>rustc_private</code> and nightly artifacts from CI</p>



<a name="218946759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218946759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218946759">(Dec 05 2020 at 18:29)</a>:</h4>
<p>... -Z self-profile does not seem to be generating any files?</p>



<a name="218946810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218946810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218946810">(Dec 05 2020 at 18:30)</a>:</h4>
<p>I'm running <code>cargo rustc -v --lib -- -Z self-profile -v</code>, and <code>fd mm_profdata</code> has no results</p>



<a name="218946927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218946927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218946927">(Dec 05 2020 at 18:33)</a>:</h4>
<p>I know the argument is getting through because -Z time-passes has lots of output</p>



<a name="218947182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947182">(Dec 05 2020 at 18:39)</a>:</h4>
<p>oh hmm I just found a bunch of profdata files lying around that weren't there before, maybe because I called rustc directly instead of going through cargo</p>



<a name="218947208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947208">(Dec 05 2020 at 18:40)</a>:</h4>
<p>ahhh cargo was putting them in the workspace root</p>



<a name="218947430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947430">(Dec 05 2020 at 18:45)</a>:</h4>
<p><a href="https://github.com/rust-lang/cargo/issues/8947">https://github.com/rust-lang/cargo/issues/8947</a></p>



<a name="218947602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947602">(Dec 05 2020 at 18:49)</a>:</h4>
<p>ok so the issue is that rustc is spending a truly inordinate amount of time on llvm:</p>
<div class="codehilite"><pre><span></span><code>+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                             | Self time | % of total time | Time     | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                     | 38.90s    | 42.103          | 38.90s   | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_module                                   | 19.08s    | 20.652          | 19.95s   | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                      | 18.82s    | 20.369          | 18.82s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen                              | 1.92s     | 2.080           | 40.82s   | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| typeck                                           | 1.69s     | 1.828           | 1.96s    | 2969       |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| link_rlib                                        | 1.58s     | 1.706           | 1.58s    | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_optimize_module_passes               | 1.23s     | 1.330           | 1.23s    | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
</code></pre></div>



<a name="218947607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947607">(Dec 05 2020 at 18:49)</a>:</h4>
<p>(this is an incr-full build)</p>



<a name="218947615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947615">(Dec 05 2020 at 18:49)</a>:</h4>
<p>is there a way to see which modules take the most time?</p>



<a name="218947853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947853">(Dec 05 2020 at 18:55)</a>:</h4>
<p>If you use crox, you can see the individual optimization invocations. I know there is a PR to show the cgu name as argument, but I don't know if it is merged yet.</p>



<a name="218947902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947902">(Dec 05 2020 at 18:56)</a>:</h4>
<p>crox?</p>



<a name="218947918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947918">(Dec 05 2020 at 18:56)</a>:</h4>
<p>One of the tools of measureme. It outputs a chrome style profile file.</p>



<a name="218947931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218947931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218947931">(Dec 05 2020 at 18:57)</a>:</h4>
<p>I think it stands for chromium oxide.</p>



<a name="218948038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948038">(Dec 05 2020 at 18:59)</a>:</h4>
<p>wow, rustc spawns 261 threads to compile rustdoc!</p>



<a name="218948046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948046">(Dec 05 2020 at 19:00)</a>:</h4>
<p>are those all different calls to LLVM?</p>



<a name="218948091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948091">(Dec 05 2020 at 19:00)</a>:</h4>
<p>I guess so since there are 256 modules, the numbers are about right</p>



<a name="218948117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948117">(Dec 05 2020 at 19:01)</a>:</h4>
<p>the one taking the most time is <code>LLVM_passes</code> at 19 seconds</p>



<a name="218948125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948125">(Dec 05 2020 at 19:01)</a>:</h4>
<p>Most are probably. It doesn't spawn all threads at once I think though. I think it does wait for some to complete to keep it at or below the parallelism limit.</p>



<a name="218948139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948139">(Dec 05 2020 at 19:02)</a>:</h4>
<p>yeah it's definitely not all at once: <a href="/user_uploads/4715/hMOOAIsfMOjQqxzz1Hzmsb0O/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/hMOOAIsfMOjQqxzz1Hzmsb0O/image.png" title="image.png"><img src="/user_uploads/4715/hMOOAIsfMOjQqxzz1Hzmsb0O/image.png"></a></div>



<a name="218948194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948194">(Dec 05 2020 at 19:02)</a>:</h4>
<p>I can't find info about what LLVM_passes is doing, the call-tree doesn't show anything</p>



<a name="218948197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948197">(Dec 05 2020 at 19:03)</a>:</h4>
<p>is that just waiting for all the modules in their separate threads to finish?</p>



<a name="218948214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948214">(Dec 05 2020 at 19:03)</a>:</h4>
<p>What opt level are you at? Does <code>-Clto=no</code> help?</p>



<a name="218948219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948219">(Dec 05 2020 at 19:03)</a>:</h4>
<p>this is debug mode :(</p>



<a name="218948263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948263">(Dec 05 2020 at 19:04)</a>:</h4>
<p>although it does have debuginfo=2, let me turn that off</p>



<a name="218948296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948296">(Dec 05 2020 at 19:05)</a>:</h4>
<p>... <code>[profile.dev] debug = 1</code> is still passing -C debuginfo=2 ??</p>



<a name="218948301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948301">(Dec 05 2020 at 19:05)</a>:</h4>
<p>LLVM_passes is started at <a href="https://github.com/rust-lang/rust/blob/66c1309446236985da64b56994ceca1127ca514e/compiler/rustc_codegen_ssa/src/back/write.rs#L1519">https://github.com/rust-lang/rust/blob/66c1309446236985da64b56994ceca1127ca514e/compiler/rustc_codegen_ssa/src/back/write.rs#L1519</a></p>



<a name="218948303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948303">(Dec 05 2020 at 19:05)</a>:</h4>
<p>huh</p>



<a name="218948379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948379">(Dec 05 2020 at 19:07)</a>:</h4>
<p>debug = false too :(</p>



<a name="218948432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948432">(Dec 05 2020 at 19:08)</a>:</h4>
<p>time for more cargo bugs!</p>



<a name="218948442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948442">(Dec 05 2020 at 19:08)</a>:</h4>
<p>I found <code>-Ztime-llvm-passes=yes</code> by the way.</p>



<a name="218948462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948462">(Dec 05 2020 at 19:09)</a>:</h4>
<p>It may require <code>-Ztime-passes</code> to also be used.</p>



<a name="218948474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948474">(Dec 05 2020 at 19:09)</a>:</h4>
<p>ok I found the issue:</p>
<div class="codehilite"><pre><span></span><code>warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/joshua/rustc2/src/librustdoc/Cargo.toml
workspace: /home/joshua/rustc2/Cargo.toml
</code></pre></div>



<a name="218948488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948488">(Dec 05 2020 at 19:09)</a>:</h4>
<p>... not sure why that's required, but ok</p>



<a name="218948489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948489">(Dec 05 2020 at 19:09)</a>:</h4>
<p>maybe I should jsut build rustdoc out of tree</p>



<a name="218948551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948551">(Dec 05 2020 at 19:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20takes.20a.20long.20time.20to.20build/near/218948442">said</a>:</p>
<blockquote>
<p>I found <code>-Ztime-llvm-passes=yes</code> by the way.</p>
</blockquote>
<p>that gives me</p>
<div class="codehilite"><pre><span></span><code>time: 21.691; rss: 1542MB       codegen_to_LLVM_IR
time: 26.819; rss: 1558MB       LLVM_passes(crate)
</code></pre></div>
<p>but not much more</p>



<a name="218948557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948557">(Dec 05 2020 at 19:11)</a>:</h4>
<p>actually let me use -Z self-profile instead</p>



<a name="218948626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948626">(Dec 05 2020 at 19:12)</a>:</h4>
<p>Profiles can only be defined in the workspace root.</p>



<a name="218948664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948664">(Dec 05 2020 at 19:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20takes.20a.20long.20time.20to.20build/near/218948557">said</a>:</p>
<blockquote>
<p>actually let me use -Z self-profile instead</p>
</blockquote>
<p>that didn't give much more info:</p>
<div class="codehilite"><pre><span></span><code>+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                             | Self time | % of total time | Time     | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                     | 125.23s   | 63.881          | 125.23s  | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                      | 26.07s    | 13.299          | 26.07s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_module                                   | 21.11s    | 10.769          | 22.01s   | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_crate                                    | 5.22s     | 2.660           | 28.41s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen                              | 2.22s     | 1.132           | 127.45s  | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_optimize_module_passes               | 2.11s     | 1.074           | 2.11s    | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| link_rlib                                        | 1.91s     | 0.975           | 1.91s    | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
</code></pre></div>



<a name="218948710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948710">(Dec 05 2020 at 19:14)</a>:</h4>
<p>(why did that go up so much? it only used 40 seconds of real time)</p>



<a name="218948747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218948747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218948747">(Dec 05 2020 at 19:15)</a>:</h4>
<p>LLVM optimizations happen in parallel for each codegen unit.</p>



<a name="218949056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949056">(Dec 05 2020 at 19:23)</a>:</h4>
<p>setting <code>debuginfo = 1</code> alone cut 10 seconds off the build, in particular, link_rlib now takes almost no time:</p>
<div class="codehilite"><pre><span></span><code>| link_rlib                                        | 81.13ms   | 0.046           | 81.13ms  | 1          |
</code></pre></div>



<a name="218949121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949121">(Dec 05 2020 at 19:24)</a>:</h4>
<p>new top 6:</p>
<div class="codehilite"><pre><span></span><code>+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                             | Self time | % of total time | Time     | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                     | 125.96s   | 71.031          | 125.96s  | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                      | 18.58s    | 10.480          | 18.58s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_crate                                    | 9.74s     | 5.491           | 19.85s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_module                                   | 8.88s     | 5.008           | 9.77s    | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_optimize_module_passes               | 2.15s     | 1.214           | 2.15s    | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| typeck                                           | 1.72s     | 0.971           | 2.00s    | 2969       |
+--------------------------------------------------+-----------+-----------------+----------+------------+
</code></pre></div>



<a name="218949132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949132">(Dec 05 2020 at 19:24)</a>:</h4>
<p>didn't affect <code>LLVM_module_codegen_emit_obj</code> at all though</p>



<a name="218949158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949158">(Dec 05 2020 at 19:25)</a>:</h4>
<p>weird that codegen_crate and codegen_module switched places</p>



<a name="218949228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949228">(Dec 05 2020 at 19:26)</a>:</h4>
<p><code>emit_obj</code> is <a href="https://github.com/rust-lang/rust/blob/5bb68c31f8cef24174a7d3499de6b4ebea069900/compiler/rustc_codegen_llvm/src/back/write.rs#L793">https://github.com/rust-lang/rust/blob/5bb68c31f8cef24174a7d3499de6b4ebea069900/compiler/rustc_codegen_llvm/src/back/write.rs#L793</a></p>



<a name="218949329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949329">(Dec 05 2020 at 19:29)</a>:</h4>
<p>... all that's doing is writing an output file :(</p>



<a name="218949333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949333">(Dec 05 2020 at 19:29)</a>:</h4>
<p>how big is this file, damn</p>



<a name="218949589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949589">(Dec 05 2020 at 19:34)</a>:</h4>
<p>apparently this is using LegacyPassManager? Does anyone know why it's 'legacy'? <a href="https://llvm.org/doxygen/classllvm_1_1legacy_1_1PassManager.html">https://llvm.org/doxygen/classllvm_1_1legacy_1_1PassManager.html</a></p>



<a name="218949620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949620">(Dec 05 2020 at 19:35)</a>:</h4>
<p><a href="https://llvm.org/docs/WritingAnLLVMNewPMPass.html">https://llvm.org/docs/WritingAnLLVMNewPMPass.html</a></p>



<a name="218949754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218949754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218949754">(Dec 05 2020 at 19:38)</a>:</h4>
<p>anyway I'm feeling a little out of my depth <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218950037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950037">(Dec 05 2020 at 19:44)</a>:</h4>
<p>the legacy pass manager is the default in rust and also in clang there is a "new pass manager" have been around for years but is still experimental.</p>



<a name="218950478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950478">(Dec 05 2020 at 19:54)</a>:</h4>
<p>is there a way to add debug logging to rustc_codegen_llvm and build rustdoc using that without having to rebuild the whole compiler twice?</p>



<a name="218950479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950479">(Dec 05 2020 at 19:54)</a>:</h4>
<p>from the crox image I think that you have a cpu that can run more then 7 threads due to that is how many I see execute at the same time so I think that the biggest problem in this case is not the llvm code gen but the translation from mir to llvm ir you can see that if you expand thread 2 this result in the staircase look at all the llvm threads. I think this is common for debug builds when many threads cpus is used. if you do a release build the llvm code gen will take longer and the main thread have more time to make the mir to llvm convertion resulting more of batches of llvm threads is created in the crox image</p>



<a name="218950494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950494">(Dec 05 2020 at 19:55)</a>:</h4>
<blockquote>
<p>I think that the biggest problem in this case is not the llvm code gen but the translation from mir to llvm ir </p>
</blockquote>
<p>is there a way to find out what <em>part</em> of the translation is taking so long?</p>



<a name="218950502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950502">(Dec 05 2020 at 19:55)</a>:</h4>
<p>like a module or something?</p>



<a name="218950564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950564">(Dec 05 2020 at 19:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20takes.20a.20long.20time.20to.20build/near/218950478">said</a>:</p>
<blockquote>
<p>is there a way to add debug logging to rustc_codegen_llvm and build rustdoc using that without having to rebuild the whole compiler twice?</p>
</blockquote>
<p>I tried <code>xpy build --keep-stage 1 --stage 2 src/tools/rustdoc -v</code> but that gives an error about <code>lazy_static</code> needing to be rebuilt, probably ABI issues</p>



<a name="218950889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950889">(Dec 05 2020 at 20:03)</a>:</h4>
<p>from the crox image there modules that is compiled in thread 6,7,8 and 9 is the once that take the longest as is expected as the biggest modules is compiled first<br>
do not remember if the modules is added to the events in the crox log or not maybe helps with adding -Z self-profile-events=default,args</p>



<a name="218950955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950955">(Dec 05 2020 at 20:04)</a>:</h4>
<p>probably also wants  -Z human-readable-cgu-names</p>



<a name="218950974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950974">(Dec 05 2020 at 20:04)</a>:</h4>
<p>these are really great flags <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span> thanks so much!</p>



<a name="218950996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950996">(Dec 05 2020 at 20:05)</a>:</h4>
<p>-Z human-readable-cgu-names gives 'file name too long' unfortunately</p>



<a name="218950997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218950997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218950997">(Dec 05 2020 at 20:05)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: could not write output to /home/joshua/rustc2/target/debug/deps/rustdoc-d1788cb94b209e31.core.e41k29p2-in-rustdoc.blpus0z3-str-traits.volatile--rustc_data_structures.754dy80n-in-rustdoc.blpus0z3-sorted_map.volatile--rustc_data_structures.754dy80n-in-rustdoc.blpus0z3-stack.volatile--rustc_middle.51don9dg-in-rustdoc.blpus0z3-ty-trait_def.volatile--rustdoc.blpus0z3-passes-strip_private--std.7uelo83d-in-rustdoc.blpus0z3-sys-unix-io--std.7uelo83d-in-rustdoc.blpus0z3-sys_common-backtrace.volatile.rcgu.o: File name too long
</code></pre></div>



<a name="218951070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951070">(Dec 05 2020 at 20:07)</a>:</h4>
<p>strange without it the event in crox  will only say something like cgu0</p>



<a name="218951155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951155">(Dec 05 2020 at 20:09)</a>:</h4>
<p>lol chrome crashed trying to load the profile</p>



<a name="218951162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951162">(Dec 05 2020 at 20:09)</a>:</h4>
<p>let me close some tabs</p>



<a name="218951248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951248">(Dec 05 2020 at 20:11)</a>:</h4>
<p>yup, you're right, the names are useless <a href="/user_uploads/4715/Vj5wqIkFgZU16fPcuRSsLIFV/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/Vj5wqIkFgZU16fPcuRSsLIFV/image.png" title="image.png"><img src="/user_uploads/4715/Vj5wqIkFgZU16fPcuRSsLIFV/image.png"></a></div>



<a name="218951255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951255">(Dec 05 2020 at 20:11)</a>:</h4>
<p>can be good to add "--minimum-duration=10 " to crox command to remove all events that is 10ms or shorter</p>



<a name="218951323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951323">(Dec 05 2020 at 20:13)</a>:</h4>
<p>to not make chrome crash due to large files</p>



<a name="218951332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951332">(Dec 05 2020 at 20:13)</a>:</h4>
<p>well, chrome is working now, the file just is not very helpful because the codegen names are hashed</p>



<a name="218951347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951347">(Dec 05 2020 at 20:13)</a>:</h4>
<p>is there a way to shorten the path names and still make them human readable?</p>



<a name="218951406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951406">(Dec 05 2020 at 20:14)</a>:</h4>
<p>not that I know about</p>



<a name="218951434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951434">(Dec 05 2020 at 20:15)</a>:</h4>
<p>has this worked for you in the past?</p>



<a name="218951443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951443">(Dec 05 2020 at 20:15)</a>:</h4>
<p>at least you got the first cgu in the error</p>



<a name="218951499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951499">(Dec 05 2020 at 20:16)</a>:</h4>
<p>oh right, that will be the largest one!</p>



<a name="218951612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951612">(Dec 05 2020 at 20:18)</a>:</h4>
<p>do not remember if I ever did the -Z human-readable-cgu-names only remember some one else say it when I was looking in to this last year I already had the debug log and looked at the cgu merging logs</p>



<a name="218951623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951623">(Dec 05 2020 at 20:18)</a>:</h4>
<p>looks like rustdoc::core, rustc_data_structures::sorted_map, rustc_data_structures::stack, rustc_middle::ty::trait_def, rustdoc::passes::strip_private, std::sys::unix::io, std::sys_common::backtrace are the modules it's compiling</p>



<a name="218951629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951629">(Dec 05 2020 at 20:18)</a>:</h4>
<p>wow that's a lot at once</p>



<a name="218951651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951651">(Dec 05 2020 at 20:18)</a>:</h4>
<p>ok so rather than trying to mess with this I'm going to comment out rustdoc passes one at a time and see how long it takes before and after <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218951672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951672">(Dec 05 2020 at 20:19)</a>:</h4>
<p>and as it say volatile it is the generic functions in them</p>



<a name="218951740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951740">(Dec 05 2020 at 20:20)</a>:</h4>
<p>all except strip_private, yeah</p>



<a name="218951785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951785">(Dec 05 2020 at 20:21)</a>:</h4>
<p>you can also try to set -C  codegen-units=2000 or something so it do not merge the cgus</p>



<a name="218951834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951834">(Dec 05 2020 at 20:22)</a>:</h4>
<p>then you also get shorter cgu names</p>



<a name="218951855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951855">(Dec 05 2020 at 20:23)</a>:</h4>
<p>ok well I have good news, commenting out of rustdoc gets you half teh compile times <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218951860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951860">(Dec 05 2020 at 20:23)</a>:</h4>
<p>I removed all the <code>passes</code> modules and relevant code and it now only takes 17 seconds to compile</p>



<a name="218951862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951862">(Dec 05 2020 at 20:23)</a>:</h4>
<p>which is still not great but <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="218951916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951916">(Dec 05 2020 at 20:24)</a>:</h4>
<div class="codehilite"><pre><span></span><code>+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                             | Self time | % of total time | Time     | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                     | 25.85s    | 51.124          | 25.85s   | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_module                                   | 7.01s     | 13.874          | 7.81s    | 256        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                      | 7.00s     | 13.846          | 7.00s    | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| typeck                                           | 1.51s     | 2.980           | 1.76s    | 2635       |
+--------------------------------------------------+-----------+-----------------+----------+------------+
</code></pre></div>



<a name="218951933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951933">(Dec 05 2020 at 20:24)</a>:</h4>
<p>« We have the fastest tool in existence » « how ? » « well, it did things but was slow, now it does nothing but it’s fast » <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218951951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951951">(Dec 05 2020 at 20:25)</a>:</h4>
<p>I don't know if I'd say 17 seconds is "fast" <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218951960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218951960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218951960">(Dec 05 2020 at 20:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125799">andjo403</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20takes.20a.20long.20time.20to.20build/near/218951785">said</a>:</p>
<blockquote>
<p>you can also try to set -C  codegen-units=2000 or something so it do not merge the cgus</p>
</blockquote>
<p>this worked!</p>



<a name="218952026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952026">(Dec 05 2020 at 20:27)</a>:</h4>
<p>generated a 465 MB chrome_profile.json file <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218952096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952096">(Dec 05 2020 at 20:28)</a>:</h4>
<p>apparently the largest module is <code>hashbrown::raw</code>??</p>



<a name="218952098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952098">(Dec 05 2020 at 20:28)</a>:</h4>
<p>that's not even in rustdoc :/</p>



<a name="218952182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952182">(Dec 05 2020 at 20:30)</a>:</h4>
<p>after that is <code>alloc::vec</code> at 9.5 seconds and <code>rustdoc.blpus0z3-fallback.cgu</code> at 12 seconds</p>



<a name="218952187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952187">(Dec 05 2020 at 20:30)</a>:</h4>
<p>I don't know what the rustdoc one is - is that for the whole crate?</p>



<a name="218952217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952217">(Dec 05 2020 at 20:31)</a>:</h4>
<p>anyway I don't know what I can do about compile times in other crates :(</p>



<a name="218952258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952258">(Dec 05 2020 at 20:32)</a>:</h4>
<p>this is really frustrating</p>



<a name="218952312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952312">(Dec 05 2020 at 20:33)</a>:</h4>
<p>the downside with generic code that you as a user get the compile time, if possible reduce the number of types of hashmaps in rustdoc</p>



<a name="218952450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218952450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218952450">(Dec 05 2020 at 20:37)</a>:</h4>
<p>but it is also possible that it is some other generic function that is in some other crate that rustdoc is using that have the hashmaps</p>



<a name="218953117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218953117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218953117">(Dec 05 2020 at 20:54)</a>:</h4>
<p>I'd expect most of the hash maps to be in rustc proper :/</p>



<a name="218956958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20takes%20a%20long%20time%20to%20build/near/218956958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20takes.20a.20long.20time.20to.20build.html#218956958">(Dec 05 2020 at 22:34)</a>:</h4>
<p>so I don't forget: the command that worked was <code>cargo clean -p rustdoc &amp;&amp; cargo rustc --lib -- -Z self-profile -Z time-llvm-passes=yes -Z self-profile-events=default,args  -Z human-readable-cgu-names -C codegen-units=2000
</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>